package com.dao.hm;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import com.entity.Solution;

public interface SolutionDAO
		extends CrudRepository<Solution, Long>, JpaSpecificationExecutor<Solution>, JpaRepository<Solution, Long> {
	@Query("from Solution d where d.chanceinfo.ciid=?1")
	public List<Solution> findSomeByCiid(Long ciid);

	@Query("from Solution s where s.logic=1")
	public Page<Solution> queryNoCriteria(Pageable p);

	@Query("from Solution s where s.logic=1 and s.theme like ?1")
	public Page<Solution> queryByTheme(String theme, Pageable p);

}
